import request from '@/config/axios'

const baseURL = '/train/employee'

// 查询列表
export const getEmployeePage = async (params: PageParam) => {
  return await request.post({
    url: `${baseURL}/page-employee`,
    data: params
  })
}

// 创建
export const employeeCreate = async (data) => {
  return await request.post<boolean>({
    url: `${baseURL}/create`,
    data
  })
}

export const getEmployeeById = async (id: string) => {
  return await request.get({
    url: `${baseURL}/get-employee-by-id`,
    params: { id }
  })
}

export const updateEmployee = async (data) => {
  return await request.post<boolean>({
    url: `${baseURL}/update`,
    data
  })
}

export const deleteEmployee = async (id: string) => {
  return await request.delete<boolean>({
    url: `${baseURL}/delete?id=` + id
  })
}
